# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=libnova
pkgver=0.15.0
pkgrel=0
pkgdesc="general purpose, double precision, celestial mechanics, astrometry and astrodynamics library"
url="https://sourceforge.net/projects/libnova/"
arch="all !armv7 !armhf !riscv64" # riscv64: no build target upstream
license="GPL-2.0-only"
makedepends="
	autoconf
	automake
	libtool
"
subpackages="$pkgname-dev"
source="
	https://downloads.sourceforge.net/sourceforge/libnova/libnova-$pkgver.tar.gz
	0001-support-for-linux-musl.patch
"

build() {
	autoreconf -i

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
77ab0ccbfe462c03a21e88656cb4d6389994ea1da0ee8da997f19a83d24ad8fd9e505e70e1580b75332e826e5b7859b5f2af4417f65eb811440493ba586f2574  libnova-0.15.0.tar.gz
142342e88506a784c437b78d310c4279a5418fd5f7952f64ba99919f232a07a0bea7604569a5f59d11544b3b643fc2fd3666b2aa20a2995827611c9f7daeb26c  0001-support-for-linux-musl.patch
"
